package tzh.Demo02;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class AppCore {
    public static void main(String[] args) throws Exception{
        Class<?> C = Class.forName("tzh.Demo02.CoreService");
        Object c = C.newInstance();
        Field[] fields = C.getDeclaredFields();
        for(Field field : fields){
            field.setAccessible(true);
            Class<?> type = field.getType();
            Object o = type.newInstance();
            field.set(c,o);
        }
        Method say = C.getDeclaredMethod("say");
        say.invoke(c);


    }
}
